<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../../vue.js"></script>
</head>

<body>
  <div id="app">
    <h1>{{msg}}</h1>
  </div>
  <script>
    //data配置项是函数而不是对象
    //挂载:两种方式1.在配置项中书写el:元素或者选择器
    //2.$mount挂载
    const vm = new Vue({
      // el:'#app',
      // el:document.querySelector('#app'),
      data() {
        return {
          msg: 'hello Vue'
        }
      }
    })
    // .$mount('#app')
    //$mount挂载可以自己选择挂载时机,其他与el配置项无区别
    setTimeout(() => {
      vm.mount('#app')
    }, 2000)
    // vm.$mount('#app')
  </script>
</body>

</html>